package com.sunnada.exam.vo;

import com.sunnada.exam.po.AnswerPo;
import com.sunnada.exam.po.QuestionPo;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class QuestionVo {
    private String que;
    private List<AnswerVo> ansSelect = new ArrayList<>();

    public QuestionVo(){}

    public QuestionVo(QuestionPo questionVo){
        this.que = questionVo.getQuestion();
    }

    public void setAnsSelect(List<AnswerPo> alist){
        for (AnswerPo answerPo : alist) {
            AnswerVo answerVo = new AnswerVo(answerPo);
            ansSelect.add(answerVo);
        }
    }
}
